package com.suncnpap.library.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.app.util.database.mybatis.Page;
import com.suncnpap.library.service.BookLossService;
import com.suncnpap.library.mapper.BookLossMapper;
import com.suncnpap.library.model.BookLoss;
import com.suncnpap.library.model.BorrowBookInfo;

/** 
 * 说明： 图书丢失Service实现类
 * @version
 */
@Service("bookLossService")
public class BookLossServiceImpl implements BookLossService{

	
	@Autowired
	BookLossMapper bookLossMapper;
	
	@Override
	public void add(BookLoss obj) {
		// TODO Auto-generated method stub
		bookLossMapper.add(obj);
	}

	@Override
	public void update(BookLoss obj) {
		// TODO Auto-generated method stub
		bookLossMapper.edit(obj);
	}

	@Override
	public void deleteById(String strId) {
		// TODO Auto-generated method stub
		bookLossMapper.deleteById(strId);
		
	}
	@Override
	public void deleteMore(String[] strIds) {
		// TODO Auto-generated method stub
		bookLossMapper.deleteMore(strIds);
	}

	@Override
	public Page list(Page page) {
		// TODO Auto-generated method stub
		List<BookLoss> list = bookLossMapper.datalistPage(page);
		page.setDataList(list);
		return page;
	}


	@Override
	public int findCount(Page page) {
		// TODO Auto-generated method stub
		return bookLossMapper.findCount(page);
	}

	@Override
	public BookLoss findById(String strId) {
		// TODO Auto-generated method stub
		return bookLossMapper.findById(strId);
	}
	
	@Override
	public Page listInfo(Page page) {
		// TODO Auto-generated method stub
		List<BorrowBookInfo> list = bookLossMapper.dataInfolistPage(page);
		page.setDataList(list);
		return page;
	}
	
	@Override
	public void deleteByBookBarcode(String strBookBarcode, String strSchoolId){
		bookLossMapper.deleteByBookBarcode(strBookBarcode, strSchoolId);
	}
	
	@Override
	public BookLoss findByBookBarcode(String strBookBarcode, String strSchoolId){
		return bookLossMapper.findByBookBarcode(strBookBarcode, strSchoolId);
	}
}

